﻿ 

namespace XFGameFramework
{

    public abstract class Model : IReuseable
    {

        #region 属性

        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; } = -1; // 默认等于 -1

        /// <summary>
        /// 当前数据所在的模块
        /// </summary>
        public Module Module { get; internal set; }
          
        #endregion

        #region 方法


        /// <summary>
        /// 添加Model时调用
        /// </summary>  
        public virtual void OnInit() { }

        /// <summary>
        /// 移除Model时调用
        /// </summary>
        public virtual void OnExit() { }

         
        /// <summary>
        /// 通过 ClassObjectPoolManager 创建时调用,
        /// </summary>
        public void OnLoaded()
        {
            
        }

        /// <summary>
        /// 通过 ClassObjectPoolManager 回收时调用,
        /// </summary>
        public void OnUnloaded()
        {
           
        }

        #endregion


    }

}